<?php
namespace app\index\model;
use think\Db;
use think\Model;

class Complaints extends Model
{
	//添加投诉内容
    public static function ComplaintSet($data){
    	 $rs=Db::name('complaint')
    	           ->insert($data);     
         return $rs;
    }
    //查询投诉内容
    public static function ComplaintSel($uid){
         $complaint=Db::name('complaint')
                   ->where('uid','eq',$uid)
                   ->where("state!=1")
                   ->select();     
         return $complaint;
    }
    //判断投诉是否重复
     public static function repetitionSel($uid,$nearby_id){
         $repetition=Db::name('complaint')
                   ->where('uid','eq',$uid)
                   ->where('nearby_id','eq',$nearby_id)
                   ->select();     
         return $repetition;
    }
    
}  